using System;
using System.Collections.Generic;
using System.Text;
using emp.IDAL;
using System.Collections;
using emp.Model;
using emp.Utility;
using System.Data.SqlClient;
using System.Data;

namespace emp.SqlServerDAL
{
    public class CellDetail:ICellDetail
    {

        #region ICellDetailDetail Members

        public IList getCellDetailList(int iCellID)
        {
            string SQL_SELECT_CAL_LIST = "SELECT";

            SQL_SELECT_CAL_LIST += " cld_id,cld_cll_id,cld_ctr_id";
            SQL_SELECT_CAL_LIST += " FROM cell_list_detail where cld_cll_id=" + iCellID + " order by cld_id desc";
            IList celllist = new ArrayList();
            SqlParameter[] parms = new SqlParameter[] { };
            //Execute a query to read the products
            using (SqlDataReader rdr = SQLHelper.ExecuteReader(SQLHelper.CONN_STRING_NON_DTC, CommandType.Text, SQL_SELECT_CAL_LIST, parms))
            {
                while (rdr.Read())
                {
                    CellDetailInfo cellinfo =new CellDetailInfo();
                    cellinfo .CellDetailID = rdr.GetInt32(0);
                    cellinfo .CellID = rdr.GetInt32(1);
                    cellinfo.Cld_CTR_ID = rdr.GetInt32(2);
                  //  Customer customer = new Customer();
                   // NewCustomerInfo customerinfo = (NewCustomerInfo)customer.GetModifyInfoByID(rdr.GetInt32(2))[0];
                   // cellinfo.CTRName = customerinfo.CTR_NAME;
                    celllist.Add(cellinfo);
                }
            }
            return celllist;
        }

        



        #endregion
    }
}
